package per.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * @author joker
 * @date 2022/5/13 0013 - 13:38
 */
@Aspect
@Component
public class CalAop {

    @Before("execution(public int per.aop.Caculater.*(int,int))")
    public void m1(JoinPoint joinPoint){
        Object[] args = joinPoint.getArgs();
        System.out.println(Arrays.toString(args));
        System.out.println("m1");
    }
    @Before("execution(public int per.aop.Caculater3.*(int,int))")
    public void m2(){
        System.out.println("m2");
    }
}
